<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()
			+ "://" + request.getServerName() + ":" 
			+ request.getServerPort()+path;
request.setAttribute("path", path);
request.setAttribute("basePath", basePath); 
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>文件上传</title>
<style type="text/css">
body{margin: 0px;padding: 0px}
table{margin: 0px auto;margin-top:20px;}
</style>
<script type="text/javascript" src="${basePath}/js/jquery-1.11.2.min.js"></script>
<script type="text/javascript">
var msg='${msg}';
if(msg!=""){
	alert(msg);
}
function mySubmit(){
	var version=$('#version').val();
	if(version==""){
		alert("请填写文件版本号");
		return ;
	}
	var file_upload=$('#file_upload').val();
	if(file_upload==""){
		alert("请选择文件");
		return ;
	}
	$("#form").submit();
}

function form2Sub()
{
	var file_upload=$('#file_upload2').val();
	if(file_upload==""){
		alert("请选择图片");
		return ;
	}
	$("#form2").submit();
}
</script>

</head>
<body>
	<form id="form" action="${basePath}/app/insertApp.do" method="post" enctype="multipart/form-data" >
		<table>
			<tr>
				<td>文件版本号:</td>
				<td><input type="text" name="version" id="version"  autocomplete="off"/></td>
			</tr>
			<tr>
				<td>选择文件:</td>
				<td><input type="file" name="file_upload" id="file_upload" value="上传"  autocomplete="off"/>  </td>
			</tr>
			<tr>
				<td colspan="2" style="text-align: center">
					<input type="button"  onclick="mySubmit()" value="提交" />
				</td>
			</tr>
		</table>
	</form>
	
	<%-- <form id="form2" action="${basePath}/uploadImage/uploadImage.do" method="post" enctype="multipart/form-data" >
		<table>
			<tr>
				<td>选择图片:</td>
				<td><input type="file" name="file" id="file_upload" value="上传"  autocomplete="off"/>  </td>
			</tr>
			<tr>
				<td>填写水印文字:</td>
				<td><input type="text" name="waterMarkStr"  autocomplete="off"/> </td>
			</tr>
			<tr>
				<td colspan="2" style="text-align: center">
					<input type="button"  onclick="form2Sub()" value="提交" />
				</td>
			</tr>
		</table>
	</form> --%>
</body>
</html>